এমন একটি প্রোগ্রাম লিখ, যা ব্যবহারকারীর কাছ থেকে একটি পাসওয়ার্ড নিবে। সঠিক পাসওয়ার্ড প্রদান করলে দেখাবে Successfully Log In আর যদি ভুল পাসওয়ার্ড প্রদান করে, তাহলে দেখাবে Wrong Password. যদি ৫ বার ভুল পাসওয়ার্ড দেয়, তাহলে Access Denied মেসেজ দেখাবে।
প্রোগ্রামঃ
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char password[] = "1234";
char temp_password[100];
int input ()
{
    printf ("Password: ");
    gets (temp_password);
	int match = strcmp (password,temp_password);
	return match;
}
int main ()
{
	int count = 0;
	for (;;)
	{
		if (input () == 0)
		{
			printf ("Welcome \nLogged In \n");
			exit(0);
		}
		else
		{
		    if (count < 4)
		    printf ("Wrong Password \n");
			count++;
			if (count == 5)
			{
				printf ("Access Denied");
				exit(0);
			}
		}
	}
}
		 
	
 
                                        






 
                             
                            